#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void fun(int* arr,int sz)
{
	int* left = arr;
	int* right = arr+sz-1;
	while (left < right)
	{
		while (*left / 2 == 0 && left < right)
		{
			left++;
		}

		while (*right / 2 == 1 && left < right)
		{
			right--;
		}

		if (left < right)
		{
			int temp = *left;
			*left = *right;
			*right = temp;
		}



	}
}





int main()
{
	int arr[] = {4,5,6,78,13,2,45,78,56,45,21};
	int sz = (int)sizeof(arr) / sizeof(arr[0]);
	fun(arr, sz);
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%d",arr[i]);
	}
	return 0;
}